3.104 \(\int \frac {\tan ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx\)

Optimal. Leaf size=107 \[ \frac {3 \sec (e+f x) \sqrt {a \sin (e+f x)+a}}{4 a f}-\frac {\sec (e+f x)}{2 f \sqrt {a \sin (e+f x)+a}}+\frac {5 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a \sin (e+f x)+a}}\right )}{4 \sqrt {2} \sqrt {a} f} \]

[Out]

5/8*arctanh(1/2*cos(f*x+e)*a^(1/2)*2^(1/2)/(a+a*sin(f*x+e))^(1/2))/f*2^(1/2)/a^(1/2)-1/2*sec(f*x+e)/f/(a+a*sin
(f*x+e))^(1/2)+3/4*sec(f*x+e)*(a+a*sin(f*x+e))^(1/2)/a/f

________________________________________________________________________________________

Rubi [A]  time = 0.20, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2712, 2855, 2649, 206} \[ \frac {3 \sec (e+f x) \sqrt {a \sin (e+f x)+a}}{4 a f}-\frac {\sec (e+f x)}{2 f \sqrt {a \sin (e+f x)+a}}+\frac {5 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a \sin (e+f x)+a}}\right )}{4 \sqrt {2} \sqrt {a} f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^2/Sqrt[a + a*Sin[e + f*x]],x]

[Out]

(5*ArcTanh[(Sqrt[a]*Cos[e + f*x])/(Sqrt[2]*Sqrt[a + a*Sin[e + f*x]])])/(4*Sqrt[2]*Sqrt[a]*f) - Sec[e + f*x]/(2
*f*Sqrt[a + a*Sin[e + f*x]]) + (3*Sec[e + f*x]*Sqrt[a + a*Sin[e + f*x]])/(4*a*f)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2649

Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[-2/d, Subst[Int[1/(2*a - x^2), x], x, (b*C
os[c + d*x])/Sqrt[a + b*Sin[c + d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2712

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*tan[(e_.) + (f_.)*(x_)]^2, x_Symbol] :> Simp[(b*(a + b*Sin[e +
 f*x])^m)/(a*f*(2*m - 1)*Cos[e + f*x]), x] - Dist[1/(a^2*(2*m - 1)), Int[((a + b*Sin[e + f*x])^(m + 1)*(a*m -
b*(2*m - 1)*Sin[e + f*x]))/Cos[e + f*x]^2, x], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0] &&  !IntegerQ
[m] && LtQ[m, 0]

Rule 2855

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.)
 + (f_.)*(x_)]), x_Symbol] :> -Simp[((b*c + a*d)*(g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^m)/(a*f*g*(p +
1)), x] + Dist[(b*(a*d*m + b*c*(m + p + 1)))/(a*g^2*(p + 1)), Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x]
)^(m - 1), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && EqQ[a^2 - b^2, 0] && GtQ[m, -1] && LtQ[p, -1]

Rubi steps

\begin {align*} \int \frac {\tan ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx &=-\frac {\sec (e+f x)}{2 f \sqrt {a+a \sin (e+f x)}}+\frac {\int \sec ^2(e+f x) \sqrt {a+a \sin (e+f x)} \left (-\frac {a}{2}+2 a \sin (e+f x)\right ) \, dx}{2 a^2}\\ &=-\frac {\sec (e+f x)}{2 f \sqrt {a+a \sin (e+f x)}}+\frac {3 \sec (e+f x) \sqrt {a+a \sin (e+f x)}}{4 a f}-\frac {5}{8} \int \frac {1}{\sqrt {a+a \sin (e+f x)}} \, dx\\ &=-\frac {\sec (e+f x)}{2 f \sqrt {a+a \sin (e+f x)}}+\frac {3 \sec (e+f x) \sqrt {a+a \sin (e+f x)}}{4 a f}+\frac {5 \operatorname {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{4 f}\\ &=\frac {5 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{4 \sqrt {2} \sqrt {a} f}-\frac {\sec (e+f x)}{2 f \sqrt {a+a \sin (e+f x)}}+\frac {3 \sec (e+f x) \sqrt {a+a \sin (e+f x)}}{4 a f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.26, size = 118, normalized size = 1.10 \[ -\frac {\sec (e+f x) \left (-3 \sin (e+f x)+(5+5 i) (-1)^{3/4} \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )^2 \tanh ^{-1}\left (\left (\frac {1}{2}+\frac {i}{2}\right ) (-1)^{3/4} \left (\tan \left (\frac {1}{4} (e+f x)\right )-1\right )\right )-1\right )}{4 f \sqrt {a (\sin (e+f x)+1)}} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^2/Sqrt[a + a*Sin[e + f*x]],x]

[Out]

-1/4*(Sec[e + f*x]*(-1 + (5 + 5*I)*(-1)^(3/4)*ArcTanh[(1/2 + I/2)*(-1)^(3/4)*(-1 + Tan[(e + f*x)/4])]*(Cos[(e
+ f*x)/2] - Sin[(e + f*x)/2])*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^2 - 3*Sin[e + f*x]))/(f*Sqrt[a*(1 + Sin[e
+ f*x])])

________________________________________________________________________________________

fricas [B]  time = 0.43, size = 200, normalized size = 1.87 \[ \frac {5 \, \sqrt {2} {\left (\cos \left (f x + e\right ) \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} \sqrt {a} \log \left (-\frac {a \cos \left (f x + e\right )^{2} + 2 \, \sqrt {2} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )} + 3 \, a \cos \left (f x + e\right ) - {\left (a \cos \left (f x + e\right ) - 2 \, a\right )} \sin \left (f x + e\right ) + 2 \, a}{\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right ) + 4 \, \sqrt {a \sin \left (f x + e\right ) + a} {\left (3 \, \sin \left (f x + e\right ) + 1\right )}}{16 \, {\left (a f \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a f \cos \left (f x + e\right )\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

1/16*(5*sqrt(2)*(cos(f*x + e)*sin(f*x + e) + cos(f*x + e))*sqrt(a)*log(-(a*cos(f*x + e)^2 + 2*sqrt(2)*sqrt(a*s
in(f*x + e) + a)*sqrt(a)*(cos(f*x + e) - sin(f*x + e) + 1) + 3*a*cos(f*x + e) - (a*cos(f*x + e) - 2*a)*sin(f*x
 + e) + 2*a)/(cos(f*x + e)^2 - (cos(f*x + e) + 2)*sin(f*x + e) - cos(f*x + e) - 2)) + 4*sqrt(a*sin(f*x + e) +
a)*(3*sin(f*x + e) + 1))/(a*f*cos(f*x + e)*sin(f*x + e) + a*f*cos(f*x + e))

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)2/f*2*(-1/4*(sqrt(
a)*tan((f*x+exp(1))/2)+sqrt(a)-sqrt(a*tan((f*x+exp(1))/2)^2+a))/(-(-sqrt(a)*tan((f*x+exp(1))/2)+sqrt(a*tan((f*
x+exp(1))/2)^2+a))^2-2*sqrt(a)*(-sqrt(a)*tan((f*x+exp(1))/2)+sqrt(a*tan((f*x+exp(1))/2)^2+a))+a)/sign(tan((f*x
+exp(1))/2)+1)+1/8*(-3*(-sqrt(a)*tan((f*x+exp(1))/2)+sqrt(a*tan((f*x+exp(1))/2)^2+a))^3+a*(-sqrt(a)*tan((f*x+e
xp(1))/2)+sqrt(a*tan((f*x+exp(1))/2)^2+a))+sqrt(a)*(-sqrt(a)*tan((f*x+exp(1))/2)+sqrt(a*tan((f*x+exp(1))/2)^2+
a))^2+sqrt(a)*a)/(-(-sqrt(a)*tan((f*x+exp(1))/2)+sqrt(a*tan((f*x+exp(1))/2)^2+a))^2+2*sqrt(a)*(-sqrt(a)*tan((f
*x+exp(1))/2)+sqrt(a*tan((f*x+exp(1))/2)^2+a))+a)^2/sign(tan((f*x+exp(1))/2)+1)-5/8*atan((-sqrt(a)*tan((f*x+ex
p(1))/2)-sqrt(a)+sqrt(a*tan((f*x+exp(1))/2)^2+a))/sqrt(2)/sqrt(-a))/sqrt(2)/sqrt(-a)/sign(tan((f*x+exp(1))/2)+
1))

________________________________________________________________________________________

maple [A]  time = 0.58, size = 130, normalized size = 1.21 \[ \frac {\sin \left (f x +e \right ) \left (5 \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) \sqrt {a -a \sin \left (f x +e \right )}\, a +6 a^{\frac {3}{2}}\right )+5 \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) \sqrt {a -a \sin \left (f x +e \right )}\, a +2 a^{\frac {3}{2}}}{8 a^{\frac {3}{2}} \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^2/(a+a*sin(f*x+e))^(1/2),x)

[Out]

1/8*(sin(f*x+e)*(5*2^(1/2)*arctanh(1/2*(a-a*sin(f*x+e))^(1/2)*2^(1/2)/a^(1/2))*(a-a*sin(f*x+e))^(1/2)*a+6*a^(3
/2))+5*2^(1/2)*arctanh(1/2*(a-a*sin(f*x+e))^(1/2)*2^(1/2)/a^(1/2))*(a-a*sin(f*x+e))^(1/2)*a+2*a^(3/2))/a^(3/2)
/cos(f*x+e)/(a+a*sin(f*x+e))^(1/2)/f

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan \left (f x + e\right )^{2}}{\sqrt {a \sin \left (f x + e\right ) + a}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate(tan(f*x + e)^2/sqrt(a*sin(f*x + e) + a), x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {{\mathrm {tan}\left (e+f\,x\right )}^2}{\sqrt {a+a\,\sin \left (e+f\,x\right )}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)^2/(a + a*sin(e + f*x))^(1/2),x)

[Out]

int(tan(e + f*x)^2/(a + a*sin(e + f*x))^(1/2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan ^{2}{\left (e + f x \right )}}{\sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**2/(a+a*sin(f*x+e))**(1/2),x)

[Out]

Integral(tan(e + f*x)**2/sqrt(a*(sin(e + f*x) + 1)), x)

________________________________________________________________________________________